Skip to content

fix: write Hermes bootstrap marker after headless install - #12487

Closed
adriannoes wants to merge 2 commits into
omacom:quattrofrom
adriannoes:fix/12206-hermes-bootstrap-marker
Closed

adriannoes wants to merge 2 commits into
omacom:quattrofrom
adriannoes:fix/12206-hermes-bootstrap-marker

Conversation

@adriannoes

Copy link
Copy Markdown

Fixes #12206

omarchy install ai hermes sets up the runtime with the packaged
hermes-desktop install.sh --skip-setup. That path never writes
~/.hermes/hermes-agent/.hermes-bootstrap-complete.

Omarchy's own readiness check (omarchy-install-hermes-cli --check)
requires that file, so omarchy-theme-set-hermes --activate and the
one-shot migration 1788619462.sh keep saying Hermes isn't ready even
when the install works. Windows install.ps1 already stamps the same
marker; this closes the gap on the Omarchy headless path.

  • Stamp .hermes-bootstrap-complete after a usable headless runtime is
    in place (same schema as install.ps1 / writeBootstrapMarker(),
    without desktopVersion).
  • Shared helper omarchy-stamp-hermes-bootstrap used by the installer.
  • Migration 1789746834.sh backfills the marker on already-usable
    installs that are only missing the file (does not re-run install.sh).

Tests: hermes-desktop-install-test.sh, hermes-bootstrap-migration-test.sh
(plus related hermes cli/theme/migration tests). Stubbed --skip-setup
leaves no marker; Omarchy stamps a valid one; --check passes; migration
is a no-op without desktop/usable runtime and is idempotent.

Packaged install.sh --skip-setup never stamps
.hermes-bootstrap-complete. Write the install.ps1 schema after a
usable runtime is in place so --check and theme activation succeed.
Extract the stamp helper, correct packaged-vs-upstream install.sh
comments, and add a one-shot migration for usable runtimes that
are only missing the marker.
@llstrk

llstrk commented Sep 25, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

The packaged installer already writes .hermes-bootstrap-complete, so the post-install stamp has no effect on a normal install. The two parts that do change behavior, the pre-install stamp and the backfill migration, treat "venv/bin/hermes --version answers" as "install finished". That causes two problems described below. The PR also conflicts with current quattro, where this logic now lives in omarchy-install-hermes-cli --now.

Verified: the marker the helper writes (schemaVersion: 1, pinnedCommit, pinnedBranch, completedAt, no desktopVersion) matches upstream write_bootstrap_marker / Write-BootstrapMarker and passes the desktop app's marker validator. The write is atomic, an existing marker is never overwritten, and runtimes whose venv commands are missing or fail are left alone. Both PR tests pass at the PR head, and both fail against the merge-base code.

The packaged install.sh --skip-setup already writes the marker

hermes-desktop 2026.8.31-3 builds from upstream 29112bef and installs its scripts/install.sh unchanged. In that file, --skip-setup only sets RUN_SETUP=false, which skips the setup wizard. main() still ends with the marker write:

main()                               # scripts/install.sh @ 29112bef
  clone_repo
  setup_venv, install_deps           # venv/bin/hermes --version already answers here
  install_node_deps || return        # fatal on npm failure
  setup_path                         # writes ~/.local/bin/hermes
  run_setup_wizard                   # the only step --skip-setup skips
  print_success
  write_bootstrap_marker             # uses the --commit Omarchy passes

2026.9.7 (upstream 2237be35) has the same call. On the merge-base, a marker missing after install.sh makes omarchy install ai hermes stop with "Hermes runtime setup did not complete" before launch, so the "finishes and launches without a marker" state in #12206 does not come from a completed run of this installer. The PR's install test only needs the new stamp because its mock install.sh was changed to stop writing the marker, which no longer matches the shipped installer.

Impact: the fresh-install path is unchanged in practice, and the tests now model an installer that differs from the shipped one.

Suggested change: restore the mock install.sh to write the marker as upstream does. Ask the reporter how their runtime was installed (for example, an older standalone Hermes install or an interrupted install.sh) to identify the actual markerless source.

A failed or interrupted install is stamped complete and no longer retried

The pre-install stamp runs before runtime_ready and the repair guards. Upstream creates a working venv/bin/hermes several stages before the fatal Node step, setup_path and the marker, so an install that failed partway through passes the helper's --version probe.

install.sh fails after the Python stage, then the user re-runs omarchy install ai hermes Merge-base PR head
install.sh runs again yes no, the runtime is stamped first
Result install completes, --check passes prints "Hermes Desktop has been installed." and launches, with no ~/.local/bin/hermes, no Node deps, and a failing --check
Later re-runs can repair skip install.sh, because the marker now exists

Reproduced in an isolated harness whose stub install.sh follows upstream main() stage order. Migration 1789746834.sh stamps such runtimes in the same way.

Impact: the recovery described in the installer's own error message ("Re-run this command after resolving the installer error") stops working, and the marker no longer means the install finished, which the comment in omarchy-install-hermes-cli relies on.

Suggested change: do not stamp before the readiness and repair checks. Stamp only after an install.sh run has completed, or require stronger evidence than hermes --version that every upstream stage completed.

Stamping a runtime the user installed makes Remove Hermes delete it

omarchy-remove-ai-hermes treats the marker as the only proof that Omarchy owns ~/.hermes/hermes-agent, and deletes that checkout, bootstrap-cache, bin and node without prompting when the marker exists. hermes-remove-test.sh asserts that a runtime without the marker survives removal, local changes included. The migration's only ownership check is that the hermes-desktop package is present.

user-installed ~/.hermes/hermes-agent (no marker, local commit) + hermes-desktop package
  without the migration → Remove Hermes keeps the runtime and the local commit
  with the migration    → marker written → Remove Hermes deletes the runtime and the local commit

The installer's pre-install stamp also leaves a marker when the same run then refuses the runtime ("moved beyond the packaged desktop release"). That marker's pinnedCommit is the package release, not the checkout's HEAD. Reproduced in the same isolated harness, default ~/.hermes layout only.

Impact: on the default layout, removing Hermes can delete a user's own checkout and local work without asking.

Suggested change: backfill only runtimes with evidence that Omarchy installed them, never stamp ahead of the adoption and refusal checks, and add a test where a markerless user runtime survives the migration or an installer refusal followed by Remove Hermes.

Rebase onto current quattro

bin/omarchy-install-ai-hermes on quattro is now a thin wrapper around omarchy-install-hermes-cli --now, and a trial merge conflicts in that file and in test/shell.d/hermes-desktop-install-test.sh. On quattro, --check also requires the seeded native app, so a backfilled marker alone does not make it pass for runtimes without that app.

Note: if a backfill is kept, it does not re-run omarchy-theme-set-hermes --activate, so a skin activation missed by the one-shot migration 1788619462.sh only happens at the next theme change.


Review information

Test scope: Source review of the PR head, merge-base and current quattro, plus the upstream Hermes Agent source and hermes-desktop package build files for 2026.8.31-3 and 2026.9.7. The PR's tests and additional failure and ownership scenarios ran in an isolated sandbox with stubbed install.sh, package and systemd commands. No real Hermes installation, desktop session or package manager was used. The reporter's machine and actual install history were not available.

AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted follow-up questions, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for digging into #12206, @adriannoes. I reviewed this at ce88c6a and ran it on a disposable Omarchy worker. The bug it fixes doesn't reproduce, and the change adds two regressions, so it can't land as it stands.

The marker is already written. The packaged install.sh is upstream's scripts/install.sh installed unmodified (the hermes-desktop PKGBUILD copies it as-is). In that script --skip-setup only sets RUN_SETUP=false, which skips the setup wizard, and main() still ends with write_bootstrap_marker, using the --commit Omarchy passes. On the worker, with hermes-desktop 2026.8.31-3 (the version in #12206), a stock omarchy-install-hermes-cli --now from current quattro wrote .hermes-bootstrap-complete with pinnedCommit 29112bef…, and --check passed. Both the merge base and quattro also stop with "Hermes runtime setup did not complete" when the marker is missing after install.sh, so a completed run of this installer can't produce the state #12206 describes. The PR's tests pass (17/17 install, 4/4 migration) only because the mock install.sh was changed to skip the marker, which the shipped installer doesn't do.

Two regressions, both reproduced on the worker against this head:

  • bin/omarchy-install-ai-hermes:62 stamps before the readiness and repair checks, and omarchy-stamp-hermes-bootstrap only asks whether venv/bin/hermes --version answers. Upstream creates the venv several stages before the fatal npm step, setup_path and the marker. So an install that failed partway through gets stamped complete on the next run, install.sh is skipped from then on, and the missing ~/.local/bin/hermes and Node dependencies are never repaired. On the worker, removing the marker and ~/.local/bin/hermes and running the helper wrote a marker. The failure mock at test/shell.d/hermes-desktop-install-test.sh:58 exits before the venv exists, so the test never reaches this case.
  • migrations/1789746834.sh stamps any usable runtime as long as the hermes-desktop package is installed. On quattro, omarchy-remove-ai-hermes:176 treats the marker as proof that Omarchy owns ~/.hermes/hermes-agent and deletes it without asking. On the worker, the migration stamped a runtime that had a local commit on it, so Remove Hermes would then delete that user's checkout and their work.

It also conflicts with quattro. There, bin/omarchy-install-ai-hermes is now a thin wrapper around omarchy-install-hermes-cli --now, which this PR doesn't touch. A trial merge conflicts in that file and in test/shell.d/hermes-desktop-install-test.sh. This matches what the earlier community review on this PR found.

Codex Medium gave a second opinion through omabot review. It agreed on all of the above (its independence is not guaranteed), and it was the one that noticed the failure mock exits before the venv exists.

Next step: this waits on the maintainer, and my recommendation is to close it. The useful open question is on #12206: how the reporter's runtime came to exist without a marker. It could be an older standalone Hermes install, the desktop app's own bootstrap, or an interrupted install.sh. A fix should target whichever of those it was, and should only claim runtimes Omarchy can show it installed.

@adriannoes

Copy link
Copy Markdown
Author

Closing this for now.

Happy to reopen with a cleaner approach if the bug shows up again.

@adriannoes adriannoes closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-install-ai-hermes never writes the Hermes Desktop bootstrap marker, so the theme-sync/readiness check gets stuck

3 participants